class CreateLimitLists < ActiveRecord::Migration[7.2]
  def change
    create_table :limit_lists do |t|
      t.date :trade_date
      t.string :ts_code
      t.string :industry
      t.string :name
      t.decimal :close, precision: 12, scale: 3
      t.decimal :pct_chg, precision: 5, scale: 2
      t.decimal :amount, precision: 16, scale: 2
      t.decimal :limit_amount, precision: 16, scale: 2
      t.decimal :float_mv, precision: 16, scale: 2
      t.decimal :total_mv, precision: 16, scale: 2
      t.decimal :turnover_ratio, precision: 5, scale: 2
      t.decimal :fd_amount, precision: 16, scale: 2
      t.string :first_time
      t.string :last_time
      t.integer :open_times
      t.string :up_stat
      t.integer :limit_times
      t.string :limit
      t.integer :year_count
      t.string :reason

      t.timestamps
    end
    add_index :limit_lists, :trade_date
    add_index :limit_lists, :ts_code
  end
end
